** Replication code for "Winning the Game of Thrones: Leadership Succession in Modern Autocracies" **
** By Anne Meng. Prepared 11/12/20 **


*Table 1
use graph_data.dta
graph bar (asis) violent peace if year<2011, over(year, sort(year) ) stack scheme(s2mono) lintensity(3000)

*Table 2
use data.dta
logit deposed  succession_rule , robust cluster(country) 
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  replace
logit deposed  vp_rule other_rule , robust cluster(country)
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit deposed  succession_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit deposed  vp_rule other_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit deposed  succession_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit deposed  vp_rule other_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using exit_peace.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append

*Figure 3
use data.dta
logit deposed  i.succession_rule, robust cluster(country)
margins succession_rule 
marginsplot

*Table 3
use data.dta
logit transition_peace succession_rule, robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vp_rule other_rule , robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  succession_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  succession_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using peace_transition.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*Figure 4
use data.dta
logit transition_peace  i.vp_rule other_rule , robust cluster(country)
margins vp_rule 
marginsplot

*Table 4
use data.dta
logit transition_planned  vp_rule  if succession_rule==1, robust cluster(country)
outreg2 using planned.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  dec(3)  replace
logit transition_planned  vp_rule  leader_duration gdpcap oilpc lpop ethfrac coldwar british french if succession_rule==1, robust cluster(country)
outreg2 using planned.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  dec(3)  append

*Figure 5
use data.dta
logit transition_planned  i.vp_rule if succession_rule==1 , robust cluster(country)
margins vp_rule 
marginsplot



*******ONLINE APPENDIX**********

*Exit type multinomial logit (Table A5)
use data.dta
mlogit exitcode succession_rule, base(1) robust cluster(ccode)
outreg2 using exittype.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  replace
mlogit exitcode succession_rule constitution_dummy rulingparty leader_duration, base(1) robust cluster(ccode)
outreg2 using exittype.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append
mlogit exitcode succession_rule constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac  british french, base(1) robust cluster(ccode)
outreg2 using exittype.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append

*OLS (Table A6)
use data.dta
reg transition_peace  succession_rule , robust cluster(country) 
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  replace
reg transition_peace  vp_rule other_rule , robust cluster(country)
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append
reg transition_peace  succession_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append
reg transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append
reg transition_peace  succession_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append
reg transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using ols.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append

*Vague Succession Rules (Table A7)
use data.dta
logit transition_peace  succession_rule vague_succession constitution_dummy rulingparty leader_duration, robust cluster(country) 
outreg2 using vague.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  replace
logit transition_peace  succession_rule vague_succession  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using vague.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append

*Global sample (Table A8)
use global_data.dta
logit transition_peace party fties, robust cluster(ccode)
outreg2 using global.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace party fties i.ccode, robust cluster(ccode)
outreg2 using global.doc, aster(coef) alpha(0.001, 0.01, 0.05) dec(3)  append

*Dropping short successor spells (Table A9)
use data.dta
logit transition_peace  vp_long other_long , robust cluster(country)
outreg2 using deputy_long.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vp_long other_long  constitution_dummy rulingparty leader_duration, robust cluster(country)
outreg2 using deputy_long.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vp_long other_long  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using deputy_long.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*With constitutions only (Table A10)
use data.dta
logit transition_peace  succession_rule  if constitution_dummy==1, robust cluster(country) 
outreg2 using constitution.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vp_rule other_rule  if constitution_dummy==1, robust cluster(country)
outreg2 using constitution.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  succession_rule  leader_duration gdpcap oilpc lpop ethfrac coldwar british french if constitution_dummy==1, robust cluster(country)
outreg2 using constitution.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vp_rule other_rule  leader_duration gdpcap oilpc lpop ethfrac coldwar british french if constitution_dummy==1, robust cluster(country)
outreg2 using constitution.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*Count version (Table A11)
use data.dta
logit transition_peace  succession_rule_count , robust cluster(country)
outreg2 using count.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vprule_count otherrule_count , robust cluster(country)
outreg2 using count.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  succession_rule_count  constitution_count party_count leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using count.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vprule_count otherrule_count  constitution_count party_count leader_duration gdpcap oilpc lpop ethfrac coldwar british french, robust cluster(country)
outreg2 using count.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*Cold War period only (Table A12)
use data.dta
logit transition_peace  vp_rule   if year<1992, robust cluster(country)
outreg2 using coldwar.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vp_rule   constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac  british french if year<1992, robust cluster(country)
outreg2 using coldwar.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*Drop PMs (Table A13)
use data.dta
logit transition_peace  vp_rule other_rule if pm==0, robust cluster(country)
outreg2 using pm.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  replace
logit transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration if pm==0, robust cluster(country)
outreg2 using pm.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append
logit transition_peace  vp_rule other_rule  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french if pm==0, robust cluster(country)
outreg2 using pm.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.001, 0.01, 0.05) dec(3)  append

*Inherited Succession rule (Table A14)
use data.dta
logit transition_peace  succession_inherit  if first_president==0, robust cluster(country)
outreg2 using inherit.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  replace
logit transition_peace  vprule_inherit otherrule_inherit  if first_president==0, robust cluster(country)
outreg2 using inherit.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit transition_peace  succession_inherit  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french if first_president==0, robust cluster(country)
outreg2 using inherit.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append
logit transition_peace  vprule_inherit otherrule_inherit  constitution_dummy rulingparty leader_duration gdpcap oilpc lpop ethfrac coldwar british french if first_president==0, robust cluster(country)
outreg2 using inherit.doc, aster(coef) addstat(Pseudo R2, e(r2_p))  alpha(0.01, 0.05, 0.10) dec(3)  append

*Heckman model (Table A15)
use data.dta
heckprob transition_heckman succession_rule, select(exit_peace ) robust cluster(ccode)
outreg2 using transition_heckman.doc, aster(coef)   alpha(0.01, 0.05, 0.10) dec(3)  replace
heckprob transition_heckman vp_rule other_rule, select(exit_peace ) robust cluster(ccode)
outreg2 using transition_heckman.doc, aster(coef)   alpha(0.01, 0.05, 0.10) dec(3)  append
heckprob transition_heckman succession_rule   leader_duration gdpcap oilpc lpop ethfrac coldwar british french, select(exit_peace ) robust cluster(ccode)
outreg2 using transition_heckman.doc, aster(coef)   alpha(0.01, 0.05, 0.10) dec(3)  append
heckprob transition_heckman vp_rule other_rule   leader_duration gdpcap oilpc lpop ethfrac coldwar british french, select(exit_peace ) robust cluster(ccode)
outreg2 using transition_heckman.doc, aster(coef)   alpha(0.01, 0.05, 0.10) dec(3)  append


